Using the RTX64 Wizards to Create an Application or DLL
RTX64 provides two wizards in the Templates/Visual C++ branch in the supported versions of Microsoft Visual Studio:
- RTX64 Application – creates a project and solution for the development of RTX64 applications.
- RTX64 RTDLL – creates a project and solution for the development of RTX64 dynamic link libraries (RTDLLs).
The RTX64 project contains four build configurations: Windows Release, Windows Debug, RTSSRelease, and RTSSDebug. The RTX64 Application or RTDLL wizards set the project settings for each configuration according to the program and project options that you specify. The wizards can also provide a basic C/C++ program framework with which to work. This program framework can include RTX64 program elements, which contain C/C++ code to create RTX64 objects and demonstrate their use.
NOTE: RTX64 only supports absolute pathnames.
Topics:
- Creating a RTX64 application
- Creating a RTX64 RTDLL
- Compiler and linker options for the Application Wizard in Visual Studio
Creating an RTX64 Application
The RTX64 Application Wizard provides the structure for creating RTX64 applications. Use the following procedure to create an RTX64 project using the RTX64 Application Wizard in Microsoft Visual Studio.
NOTE: RTX64 does not support the building of managed RTSS applications. For additional information on using RTX64 from within a Windows managed code application, see the RTX64 Managed Code Reference Manual.
To create an RTX64 Application Project:
- From the Visual Studio menu bar select File > New > Project.
- Select Visual C++ from the Templates list.
- Select RTX64 Application from the templates area.
New image
- The wizard is a single-page dialog that displays the default project settings and provides optional application and program settings.
- To accept the current settings, click Finish. Optionally, you can specify other options and libraries that you want to include in your RTX64 application project:
New image
- SDK Version – If you have multiple versions of the SDK installed, select the version you want to use. Note that if you build a binary using the RTX64 2014 SDK, it will not load in any newer RTX64 runtime versions. And if you build a binary using the RTX64 2015 SDK, it will not load in previous version of RTX64 runtime.
- Project Type – You can create a project in C or C++. Select the type of project source you want to create.
- Supported String Convention – Specify Unicode or ASCII.
- Add additional headers and libraries:
- Add support for RT-TCP/IP – adds RT-TCP/IP support.
- Add Microsoft C/C++ Runtime Support – adds C/C++ Runtime support. Most programs need support for C Runtime functions.
- If these are all the options needed, click Finish to create the project. Otherwise, continue editing program settings for this application.
- Provide a program framework –
- The RTX64 Application Wizard can build a basic program framework consisting of source and header files, or it can build an empty project. When Provide a program framework is un-checked, the RTX64 Application Wizard sets only the project settings and does not include any header or C/C++ files, and all program elements become grayed-out. When Provide a program framework is checked, the RTX64 Application Wizard inserts into the project C/C++ source files that contain basic program functionality and header files that contain include and define statements.
- When Provide a program framework is checked, you can optionally add elements to the program framework. These code segments show proper usage of Real-time API function calls and can serve as examples of how to set up these elements. Areas in the element code that need to be customized by the user are indicated by "TO DO" comments. You can select more than one type of programming element for a single project. The following table provides the available program elements.
Element | Description |
---|---|
Event server thread |
Inserts a code segment into the program framework that creates a child thread function shell, a named event and a child thread, and sets thread priorities and resumes/suspends threads. The user should supply the child thread function code, the event name and exception code. This option is only available if you specified an RTX64 application as the type of program to be built when you set the application settings. |
Periodic timer thread |
Creates a periodic timer function shell, and inserts a code segment into the program framework that creates and sets a periodic timer. The user should supply the timer period, the periodic timer function code, and exception code. This option is only available if you specified an RTX64 application as the type of program to be built when you set the application settings. |
Interrupt Service Routine (ISR) |
Creates a basic Interrupt Service Routine template that can be used to determine the interrupt owner when an interrupt is shared. Inserts code segments into the program framework to support interrupt sharing |
Interrupt Service Thread (IST) |
Adds support for sharing an interrupt. |
Basic Port I/O |
Inserts a code segment into the program framework that supports Port I/O. Enables/disables Port I/O, and demonstrates basic reading and writing to an I/O Port. |
Basic mapped memory |
Inserts a code segment into the program framework that supports Memory Mapping. Note: This element is not supported for serial devices. |
Export function |
Inserts a code segment into the program framework that creates a RTDLL shell. This option is only available if you specified RTDLL as the type of program to be built when you set the application settings. |
- Click Finish. The RTX64 Application Wizard generates the RTX64 solution and project according to the options you selected.
Creating an RTX64 RTDLL
RTX64 RTDLL Wizard provides the structure for creating RTX64 RTDLLs. Use the following procedure to create an RTX64 project using any RTX64 RTDLL Wizard in Microsoft Visual Studio 2013.
NOTE: RTX64 does not support the building of managed RTSS applications. For additional information on using RTX64 from within a Windows managed code application, see the RTX64 Managed Code Reference Manual.
To create an RTX64 RTDLL Project:
- From the Visual Studio menu bar select File > New > Project.
- Select Visual C++ from the Templates list.
- Select RTX64 RTDLL Wizard from the templates area.
- The wizard is a single-page dialog that displays the default project settings and provides optional application and program settings. To accept the current settings, click Finish. To specify different settings for your RTX64 application project, specify new application settings:
-
SDK Version: If you have multiple versions of the SDK installed, select which version you want to use. Note that if you build a binary using the RTX64 2013 SDK, it will not load in any newer RTX64 runtime versions. And if you build a binary using the RTX64 2014 SDK, it will not load in previous version of RTX64 runtime.
Application Type: The RTX64 Application Wizard sets the Application Settings in each configuration for compiling and linking programs. To build an RTX64 application, select Real-Time application (RTSS). To build an RTDLL, select Real-Time Dynamic Link Library (RTDLL).
Add additional headers and libraries:
Add support for RT-TCP/IP – adds RT-TCP/IP support.
Add Microsoft C/C++ Runtime Support – adds C/C++ Runtime support. Most programs need support for C Runtime functions.
Source Code: You can create a project in C or C++. Select the type of project source you want to create.
Supported String Convention: Choose Unicode or ASCII.
- If these are all the options needed, click Finish to create the project. Otherwise, continue editing program settings for this application:
- The RTX64 Application Wizard can build a basic program framework consisting of source and header files, or it can build an empty project. If Empty Project is un-checked, the RTX64 Application Wizard inserts into the project C/C++ source files that contain basic program functionality and header files that contain include and define statements. If Empty Project is checked, the RTX64 Application Wizard sets only the project settings and does not include any header or C/C++ files, and all program elements become grayed-out.
- If Empty Project is un-checked, RTX64 program elements can be included into the program framework. These code segments show proper usage of Real-time API function calls and can serve as examples of how to set up these elements. Areas in the element code that need to be customized by the user are indicated by "TO DO" comments. You can select more than one type of programming element for a single project. The following table provides the available program elements.
Element | Description |
---|---|
Event server thread |
Inserts a code segment into the program framework that creates a child thread function shell, a named event and a child thread, and sets thread priorities and resumes/suspends threads. The user should supply the child thread function code, the event name and exception code. This option is only available if you specified an RTX64 application as the type of program to be built when you set the application settings. |
Periodic timer thread |
Creates a periodic timer function shell, and inserts a code segment into the program framework that creates and sets a periodic timer. The user should supply the timer period, the periodic timer function code, and exception code. This option is only available if you specified an RTX64 application as the type of program to be built when you set the application settings. |
Interrupt Service Routine (ISR) |
Creates a basic Interrupt Service Routine template that can be used to determine the interrupt owner when an interrupt is shared. Inserts code segments into the program framework to support interrupt sharing |
Interrupt Service Thread (IST) |
Adds support for sharing an interrupt. |
Basic Port I/O |
Inserts a code segment into the program framework that supports Port I/O. Enables/disables Port I/O, and demonstrates basic reading and writing to an I/O Port. |
Basic mapped memory |
Inserts a code segment into the program framework that supports Memory Mapping. Note: This element is not supported for serial devices. |
Export function |
Inserts a code segment into the program framework that creates a RTDLL shell. This option is only available if you specified RTDLL as the type of program to be built when you set the application settings. |
- Click Finish. The RTX64 Application Wizard generates the RTX64 solution and project according to the options you selected.
NOTE: RTX64 utilizes a custom macro, $(Rtx64Platform)
, that is used to find the correct library directory for projects. This custom macro requires two property files, which are installed with the RTX64 SDK:
- Rtx64.cpp.x64.user.props
- Rtx64.cpp.win32.user.props
All projects import these property files. If they are edited in any way, projects will not load correctly.
Compiler and Linker Options
For a complete list, see Compiler and Linker Options for the RTX64 Application Wizard Using Visual Studio 2013.